﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Silverlight.Arcgis.MapTip
{
    public partial class 主显示框架 : UserControl
    {
        public 主显示框架()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 选择切换时出现的事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            borContent.Child = null;
            //得到类型
            Type typeObj = Type.GetType("Silverlight.Arcgis.MapTip." + (((ListBox)sender).SelectedItem as ListBoxItem).Tag.ToString());

            //创建一个新的对像
            UIElement uiEl = Activator.CreateInstance(typeObj) as UIElement;

            //;设定子原素
            borContent.Child = uiEl;

            
        }
    }
}
